package com.pj.lib.auraClient.API;

import com.pj.lib.aura.connection.Result;
import com.pj.lib.auraClient.Aura;
import com.pj.lib.auraClient.AuraComponent;

import com.pj.lib.auraClient.interfaces.OnAuraSensitiveUserAPI;
import com.pj.lib.auraClient.interfaces.OnServiceConnection;

public class AuraSensitiveUser extends AuraComponent{
	private static final String TAG = "AuraSensitiveUser";
	private Boolean waiting = false;
	
	private Result result;
	
	public AuraSensitiveUser(Aura aura) {
		super(aura);
		
		if(getAura().isServiceBounded()) {
			getAura().getService().addOnAuraSensitiveUserApiListener(new AuraSensitiveUserAPIHandler());
		} else {
			getAura().addOnServiceConnectionListener(new OnServiceConnection() {
				
				@Override
				public void serviceConnection(Boolean isConnected) {
					if(isConnected) {
						getAura().getService().addOnAuraSensitiveUserApiListener(new AuraSensitiveUserAPIHandler());
					}
				}
			});
		}
	}

	synchronized private void resume() {
		notify();
	}
	synchronized private void pause() throws InterruptedException {
		waiting = true;
		wait();
	}
	
	private class AuraSensitiveUserAPIHandler implements OnAuraSensitiveUserAPI {
		
	}
}
